import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
const { resolve } = require("path");
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
    },
  },
  server: {
    port: 3001,
    proxy: {
      "/api": {
        target: "http:127.0.0.1",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""), // 重写路径 比如遇见 /api 就会用空格替换
      },
    },
  },
});
